The invention relates generally to graphics processing in a computer system and more particularly to a method and apparatus for multipass pixel processing.
Graphics processing operations in computer systems are becoming increasingly complex. Some applications such as computer games require complex graphical images to be generated and displayed. In order to enable these complex, highly-detailed images to be generated and displayed in an efficient manner, numerous operations that add and modify colors associated with the images are performed in order to enhance the resulting display.
Computer displays and other high resolution display devices such as high definition televisions (HDTV), projectors, printers, plotters, and the like, present an image to the viewer as an array of individual picture elements, or pixels. The individual pixels are each given a specific color, which corresponds to the color of the image at the location of the particular pixel. The pixels are closely spaced, and the viewers visual system performs a filtering of the individual pixel colors to form a composite image. If the partitioning of the image into individual pixel elements is performed properly, and the pixels are close enough together, the viewer perceives the displayed array of pixels as a virtually continuous image.
One technique often used to modify and enhance the colors associated with various pixels on the display is texture mapping. In order to display some screen images, detailed textures are stored in memory. These textures are then molded and adapted to overlay or map to structures for display. An example is a brick pattern that is mapped to a wall structure, where if the wall is extending into the distance, the texture will be mapped in such a way as to show perspective.
In many cases these textures are modified or combined in order to further enhance their utility. An example would be the blending the input of two separate textures to effectively form a composite texture. Another example includes modifying the lighting of the texture so as to simulate light coming from a singular source or from multiple sources. In some cases, a single texture may be modified by a number of operations in order to generate a new texture for use.
In some instances it may be desirable to modify a single object, which is made up of one or more video graphics primitives, using multiple textures and/or functions that affect the final color value for each of the pixels corresponding to the object. In prior art systems, a limited set of instructions would often be provided that would enable a fixed array of operators to act on a particular set of pixels as it passed through the graphics pipeline. A further limitation is realized in that the pipeline may have hardware limitations that restrict the number of textures that can be used in the processing of a graphics primitive. For example, the pipeline may only include the circuitry to allow four textures to be used in modifying the data for each primitive as it passes through the pipeline. In such a limited system, no operations using five or more textures could be performed.
Thus, although such prior art systems were capable of allowing a pixel to be modified by a limited number of textures, the variety of operations was confined both by the hardware used to implement the graphics pipeline and the set of instructions provided for utilizing that hardware. These limitations are undesirable in video graphic systems that may require very complex operations to be performed in order to determine the appropriate color for a particular pixel. Although adding additional circuitry to the graphics pipeline and more instructions to the set of instructions supported alleviates some of these limitations, the overall functionality is still limited by the hardware and instructions. Additionally, the cost associated with adding such additional hardware and instruction support is undesirable.
Therefore, a need exists for a method and apparatus for pixel processing that enables complex and configurable pixel processing operations to be performed in a highly-flexible manner utilizing a limited amount of circuitry included in the graphics pipeline.